<?php
/**********************************************************************//**\file
	Armory Wowheroes Data

	Description:  Wowheroes data model, provides a consistent interface to guild
		information pulled from wowheroes.com
*******************************************************************************/

	class wowheroesdata
	{
		protected $players = array();

		public function __construct()
		{
			
		}

		public function add_player($name, $score, $date, $suggest)
		{
			$this->players[] = array('name' => $name, 'score' => $score, 'date' => $date, 'suggest' => $suggest);
		}

		public function store()
		{
			$db = new armorydb();

			foreach($this->players as $var)
			{
				$time = time();

				# Update extant record
				$db->query("UPDATE armory_player SET player_gearscore = {$var['score']}, player_geardate = '{$var['date']}', player_gearsuggest = '{$var['suggest']}' WHERE player_name = '{$var['name']}'");
			}

			unset($db);
		}

		public function debug()
		{
			var_dump($this->players);
		}
	}
?>
